#include <iostream>
using namespace std;
struct node{
    int data1,data2;
    struct node *next;
  };
int main()
{
  struct node *head,*q,*p,*t;
  head=NULL;
  int n,i,a,b;
  cin>>n;
  for(i=0;i<n;i++){
    cin>>a>>b;
    p=(struct node *)malloc(sizeof(struct node));
    p->data1=a;
    p->data2=b;
    p->next=NULL;
    if(head==NULL) head=p;
    else q->next=p;
    }
  t=head;
  int s=0;
  int x=0;
  while(t!=NULL){
    s+=t->data1;
    x+=t->data2;
    t=t->next;
  }
  cout<<s<<"+"<<x<<"i"<<endl;
  return 0;
}


